﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace MallProject.Model
{
    public class Products
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string NamePlain { get; set; }
        public float Price { get; set; }
        public int Quantity { get; set; }
        public int Status { get; set; }
        public int CreatedBy { get; set; }
        public int ModifiedBy { get; set; }
        public DateTime CreatedDate { get; set; }
        public DateTime ModifiedDate { get; set; }
        public string Description { get; set; }
        public string Details { get; set; }
        public int ShoppingID { get; set; }
        public Products()
        {

        }
        public Products(DataRow dr)
        {
            this.Id = Convert.ToInt32(dr["id"].ToString());
            this.Name = dr["name"].ToString();
            this.NamePlain = dr["name_plain"].ToString();
            this.Price = Convert.ToSingle(dr["price"].ToString());
            this.Quantity = Convert.ToInt32(dr["quantity"].ToString());
            this.Status = Convert.ToInt32(dr["status"].ToString());
            this.CreatedBy = Convert.ToInt32(dr["created_by"].ToString());
            this.ModifiedBy = Convert.ToInt32(dr["modified_by"].ToString());
            this.CreatedDate = Convert.ToDateTime(dr["created_date"].ToString());
            this.ModifiedDate = Convert.ToDateTime(dr["modified_date"].ToString());
            this.Description = dr["description"].ToString();
            this.Details = dr["details"].ToString();
            this.ShoppingID = Convert.ToInt32(dr["shopping_id"].ToString());
        }
    }
}